home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Applications 1996 May / SGI IRIX 6.2 Applications 1996 May.iso / dist / impr_dev.idb / usr / impressario / src / examples / libpod / message.c.z / message.c
C/C++ Source or Header  |  1996-05-06  |  2KB  |  77 lines

  1. /**************************************************************************
  2.  *
  3.  *           Copyright (c)    1992 Silicon Graphics, Inc.
  4.  *            All Rights Reserved
  5.  *
  6.  *       THIS    IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
  7.  *
  8.  * The copyright notice above does not evidence any actual of intended
  9.  * publication of such source code, and is an unpublished work by Silicon
  10.  * Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is
  11.  * the property of Silicon Graphics, Inc. Any use, duplication or
  12.  * disclosure not specifically authorized by Silicon Graphics is strictly
  13.  * prohibited.
  14.  *
  15.  * RESTRICTED RIGHTS LEGEND:
  16.  *
  17.  * Use, duplication or disclosure by the Government is subject to
  18.  * restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
  19.  * Technical Data and Computer Software clause at DFARS 52.227-7013,
  20.  * and/or in similar or successor clauses in the FAR, DOD or NASA FAR
  21.  * Supplement. Unpublished - rights reserved under the Copyright Laws of
  22.  * the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.
  23.  * Shoreline Blvd., Mountain View, CA 94039-7311
  24.  **************************************************************************
  25.  *
  26.  * File: message.c
  27.  *
  28.  * Description: Simply demonstrates how to use the PDMakeMessage function.
  29.  *    The program does not perform any useful work as far as interacting
  30.  *    with POD files.
  31.  *
  32.  **************************************************************************/
  33.  
  34.  
  35. #ident "$Revision: 1.1 $"
  36.  
  37.  
  38. #include <stdio.h>
  39. #include <stdlib.h>
  40. #include <pod.h>
  41.  
  42.  
  43. /* ARGSUSED */
  44.  
  45. int main(int argc, char **argv)
  46. {
  47.     PDMessageStruct msg[2];
  48.     register int i;
  49.  
  50.     /*
  51.      * Construct a warning message
  52.      */
  53.     if (PDMakeMessage(&msg[0], PD_WARN_REQ_PAPER) < 0) {
  54.     PDPerror(argv[0]);
  55.     exit(1);
  56.     }
  57.  
  58.     /*
  59.      * Construct an error message
  60.      */
  61.     if (PDMakeMessage(&msg[1], PD_ERROR_WARMING_UP) < 0) {
  62.     PDPerror(argv[0]);
  63.     exit(1);
  64.     }
  65.  
  66.     /*
  67.      * Print the message list
  68.      */
  69.     for (i = 0; i < 2; i++) {
  70.         (void)printf("For message code: 0x%08X\n", msg[i].message_code);
  71.         (void)printf("Returned Std. Message: %s\n", msg[i].message_text);
  72.     (void)printf("\n");
  73.     }
  74.  
  75.     return 0;
  76. }
  77.